package com.ruoyi.psi.base.warehouse.mapper;

import com.ruoyi.psi.base.warehouse.domain.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 仓库
 * 数据层
 */
public interface WarehouseMapper {
    /**
     * 仓库查询
     * @param cond
     * @return
     */
    List<WarehouseDto> selectWarehouseList(WarehouseCond cond);

    /**
     * 按编号查询
     * @param warehouseId
     * @return
     */
    WarehouseDto selectWarehouseById(String warehouseId);
    /**
     * 仓库新增
     * @param warehouse
     * @return
     */
    int insertWarehouse(WarehouseDomain warehouse);

    /**
     * 仓库更新
     * @param warehouse
     * @return
     */
    int updateWarehouse(WarehouseDomain warehouse);

    /**
     * 更新仓库删除标志位
     * @param warehouse
     * @return
     */
    int updateWarehouseDeleteFlag(WarehouseDomain warehouse);

    /**
     * 仓库详细查询
     * @param cond
     * @return
     */
    List<WarehouseListDto> selectWarehouseListList(WarehouseCond cond);

    /**
     * 查询仓库对应的所有产品详细
     * @param warehouseId 仓库编号
     * @return
     */
    List<WarehouseListDto> selectWarehouseListListById(String warehouseId);

    /**
     * 查询仓库对应的指定产品详细
     * @param warehouseId 仓库编号
     * @return
     */
    WarehouseListDto  selectWarehouseListById(@Param("warehouseId")String warehouseId, @Param("produceId")String produceId);
    /**
     * 查询指定产品详细
     * @param produceId 产品编号
     * @return
     */
    WarehouseListDto  selectWarehouseListByProduceId(@Param("produceId")String produceId);

    /**
     * 仓库详细新增
     * @param warehouseList 仓库详细
     * @return
     */
    int insertWarehouseList(WarehouseListDomain warehouseList);

    /**
     * 仓库详细更新
     * @param warehouseList 仓库详细
     * @return
     */
    int updateWarehouseList(WarehouseListDomain warehouseList);

    /**
     * 仓库详库存更新
     * @param produceId 产品名称
     * @param productNumber 库存数量
     * @return
     */
    int updateProduceNumber(@Param("produceId")String produceId,@Param("productNumber")Double productNumber);

    /**
     * 删除仓库详细
     * @param warehouseId  仓库编号
     * @param produceId 产品编号
     * @return
     */
    int deleteWarehouseListById(@Param("warehouseId")String warehouseId, @Param("produceId")String produceId);
}
